package com.idol.service.impl;

import com.idol.dubbo.service.IEmailService;
import org.apache.commons.lang3.StringUtils;
import org.apache.dubbo.config.annotation.Service;

/**
 * @author SupremeSir
 * @description Dubbo 服务端
 * @className EmailServiceImpl
 * @date 2021/2/15 21:32
 **/
@Service
public class EmailServiceImpl implements IEmailService {

    // 模拟发送邮件功能
    @Override
    public boolean sendEmail(String email, String code) {
        if (StringUtils.isBlank(email) && StringUtils.isBlank(code)) {
            return false;
        }
        System.out.println("向 " + email + " 邮箱发送验证码：" + code);
        return true;
    }
}
